<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Graph demo</title>

    <!-- for mobile devices like android and iphone -->
    <meta content="True" name="HandheldFriendly" />
    <meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0"  />

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript" src="../graph.js"></script>
    <!--[if IE]><script type="text/javascript" src="../excanvas.js"></script><![endif]-->
    <link rel="stylesheet" type="text/css" href="../graph.css">

    <style type="text/css">
        html, body {
            font: 10pt arial;
            padding: 0;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        div.graph-frame {
            border: none;
        }

        #info {
            position: absolute;
            z-index: 1;
            top: 0px;
            left: 0px;
        }
    </style>

    <script type="text/javascript">
        var graph = undefined;

        google.load("visualization", "1");

        // Set callback to run when API is loaded
        google.setOnLoadCallback(drawVisualization);

        // Called when the Visualization API is loaded.
        function drawVisualization() {
            // Create and populate a data table.
            var data = new google.visualization.DataTable();
            data.addColumn('datetime', 'time');
            data.addColumn('number', 'Dataset A');
            data.addColumn('number', 'Dataset B');

            function functionA(x) {
                return -Math.sin(x / 10) * Math.cos(x / 5) * 50;
            }

            function functionB(x) {
                return Math.sin(x/5) *45 + Math.cos(x / 10) * 75;
            }

            // create data
            var d = new Date(2010, 9, 28, 20, 0, 0);
            for (var i = 0; i < 50; i++) {
                data.addRow([new Date(d),
                    functionA(i) / 200,
                    functionB(i) / 200]);
                //d.setMinutes(d.getMinutes() + 1);
                d.setHours(d.getHours() + 5);
            }

            // specify options
            var options = {width:  "100%",
                height: "100%",
                lines: [
                    {color: "#2B7CE9", style: "dot", radius: 1.5},
                    {color: "#97C2FC", width: 2}]
            };

            // Instantiate our graph object.
            graph = new links.Graph(document.getElementById('mygraph'));

            // Draw our graph with the created data and options
            graph.draw(data, options);
        }
    </script>
</head>

<body onresize="graph.redraw();" >
<div id="mygraph"></div>

<div id="info"></div>
</body>
</html>
